package com.bicon.botu.mall.base.rpc.service;


import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.bicon.botu.core.base.common.Constants;
import com.bicon.botu.core.base.common.controller.BaseController;
import com.bicon.botu.core.base.common.entity.BaseResult;
import com.bicon.botu.mall.base.entity.ExpressTemplate;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 快递单RPC
 *
 * @author liushujie
 * @date 2018/5/8 0008 下午 16:05
 */
@Service
public class ExpressTemplateRpcService extends BaseController {

    /**
     * 获取已启用的快递单模板
     * @return
     */
    @RequestMapping(value = "/enabled-list", method = RequestMethod.GET)
    public BaseResult enabled() {
        List<ExpressTemplate> expressTemplateList = new ExpressTemplate().selectList(new EntityWrapper<ExpressTemplate>().eq("logic_delete", Constants.DEL_LOGIC_NORMAL).
                eq("status", 1).orderBy("sort", false));
        return new BaseResult(Constants.RESPONSE_CODE_200, Constants.RESPONSE_MESSAGE_200, expressTemplateList);
    }
}
